package rxjava.operators;


import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;

/**
 * User: Administrator
 * Date: 2021/3/24
 * Time: 13:41
 * Description:
 */
public class MapDemo {
    public static void main(String[] args) {
        Observable.create((ObservableOnSubscribe<Integer>) observableEmitter -> {
            observableEmitter.onNext(1);
            observableEmitter.onNext(2);
            observableEmitter.onNext(3);
            observableEmitter.onNext(4);
        }).map((Function<Integer, Object>) var -> "append " + var).subscribe(o -> System.out.println("accept " + o));
    }
}
